package com.tzbank.wisdom.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


import com.tzbank.wisdom.service.PayeeService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;

/**
 * 添加收款人控制器
 *
 */
@Api(tags={"添加收款人控制器"})
@Slf4j
@RequestMapping("payee")
@RestController
public class PayeeController {
    
	@Autowired
    private PayeeService payeeService;
	
	/**
	 * 添加收款人转定
	 * @param 
	 * @return
	 */
    @ResponseBody
    @PostMapping(value="/payeeAdd")
    @ApiOperation(value = "添加收款人转定", notes = "添加收款人转定接口")
    public Map<String,Object> addPayee(@RequestBody Map<String,String> reqBody) {
    	log.info("入参："+JSONObject.fromObject(reqBody));
    	return payeeService.payeeAdd(reqBody);
    }
	/**
	 * 
	 * @param 
	 * @return
	 */
    @ResponseBody
    @PostMapping(value="/payeeUpdate")
    @ApiOperation(value = "收款人修改", notes = "收款人修改接口")
    public Map<String,Object> payeeUpdate(@RequestBody Map<String,String> reqBody) {
    	log.info("入参："+JSONObject.fromObject(reqBody));
    	return payeeService.payeeUpdate(reqBody);
    }
    
	/**
	 * 
	 * @param 
	 * @return
	 */
    @ResponseBody
    @PostMapping(value="/payeeDelete")
    @ApiOperation(value = "删除收款人", notes = "删除收款人")
    public Map<String,Object> payeeDelete(@RequestBody Map<String,String> reqBody) {
    	log.info("入参："+JSONObject.fromObject(reqBody));
    	return payeeService.payeeDelete(reqBody);
    }
	/**
	 * 
	 * @param 
	 * @return
	 */
    @ResponseBody
    @PostMapping(value="/payeeQuery")
    @ApiOperation(value = "查询收款人", notes = "查询收款人")
    public Map<String,Object> payeeQuery(@RequestBody Map<String,String> reqBody) {
    	log.info("入参："+JSONObject.fromObject(reqBody));
    	return payeeService.payeeQuery(reqBody);
    }
    
}
